﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;


public class LoliCode
{

    public static string DateTime(DateTime? obj)
    {
        if (obj != null)
        {
            return obj.Value.ToString("yyyy-MM-dd");
        }
        return string.Empty;
    }

    public static string Boolean(bool? obj)
    {
        if (obj != null)
        {
            return obj == true ? "是" : "否";
        }
        return string.Empty;
    }



    public static List<SelectListItem> CreateElevatorTypeLits(int? value)
    {
        List<SelectListItem> list = new List<SelectListItem>();
        list.Add(new SelectListItem() { Text = "垂直", Value = "1" });
        list.Add(new SelectListItem() { Text = "扶梯", Value = "2" });
        list.Add(new SelectListItem() { Text = "液压", Value = "3" });

        return list;
    }


    public static string Content(string str)
    {
        return str.Replace("\r\n", "<br />");
    }
}
